module.exports = class extends think.Controller {
    __before() {

    }
    async add_dataAction() {
        let that = this;
        let { id, title, url, tags, status, type } = that.post();
        if (think.isEmpty(id) || think.isEmpty(title) || think.isEmpty(url) || think.isEmpty(type)) return that.json({ code: 1, msg: '' });
        if (['gitee', 'forum'].includes(type)) return that.json({ code: 2, msg: '' });
        let typeService = think.service(type, that.post());
        typeService.handleData();
        await typeService.addData();
        return that.json({ code: 0, msg: '' });
    }
};